<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>登陆页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta HTTP-EQUIV="pragma" CONTENT="no-cache">
	<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
	<meta HTTP-EQUIV="expires" CONTENT="0">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet"/>
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet"/>
    <link href="css/animate.css" rel="stylesheet"/>
    <script>if(window.top != window.self){ window.top.location = window.location;}</script>
    <link href="css/login.css" rel="stylesheet"/>
</head>
<body class="signin">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>
            <!--<img src='img/CMSlogo.png' class="CMSlogo"/>-->
                <h3 style="color: wheat;margin-bottom: 5px">基础桩工程运营管理平台</h3>
            </div>


            <form class="m-t" role="form">
                <div class="form-group InputBg">
                <img src="img/userLogo.png" class="userLogo"/>
                    <input type="text" class="form-control loginInut username" placeholder="用户名" required="" autocomplete="off">
                </div>
                <div class="form-group InputBg">
               <img src="img/passwordLogo.png" class="passwordLogo"/>
                    <input type="password" class="form-control loginInut password" placeholder="密码" required="" autocomplete="off">
                </div>
                <button type="button" class="btn block full-width loginBtn">登 录</button>
                <p class="rememberMe"><img src="img/checked.png" class="checkBtn"/>
                <span style="float:left">记住我</span></p>           

            </form>
            <!--<img src="img/icon/blp.png" class="LogoImg"/>-->
        </div>
    </div>

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
     <!-- 自定义js -->
    <script src="js/content.js"></script>
    <script src="js/plugins/layer/layer.min.js"></script>
    <script src="js/work/common.js"></script>
    <script>

    var rememberMe = true;

    $(".checkBtn").click(function(){
        if($(this).attr('src')=='img/checked.png'){
            $(this).attr('src','img/uncheck.png');
            rememberMe = false;
        }else{
           $(this).attr('src','img/checked.png');
           rememberMe = true;
        }
    })

    $(".loginBtn").click(function(){
        login();
    })

    keyEnter(login);

    function login() {
        var username = $(".username").val();
        var password = $(".password").val();
        $.ajax({
            url: web_url_prefix + "user/login",
            type: "GET",
            dataType: 'jsonp',
            jsonp: "callback",
            async: true,
            data: {
                username: username,
                password: password,
                appKey: appKey,
                rememberMe: rememberMe
            },
            timeout: 8000,
            error: function (xhr, type) {
                layer.msg("服务器异常，请稍后重试！", {time:2000})
            },
            success: function (data) {
                if (data.success == true) {
                    setStorage("userName", username);
                    setTimeout(function(){
                        location.href="index.html"
                    },100)
                } else {
                    layer.msg(data.message,{time:1000})
                }
            },
        });
    }
    
    </script>
    
    

</body>

</html>
